<template>
  <el-container>
    <el-header>
      <h3>管理端</h3>
    </el-header>
    <el-container>
      <el-aside width="200px">
        <el-menu active-text-color="#ffd04b" background-color="#545c64">
          <el-menu-item-group title="系统">
            <el-menu-item index="1-1" @click="toPath('user')">用户</el-menu-item>
            <el-menu-item index="1-2" @click="toPath('role')">角色</el-menu-item>
            <el-menu-item index="1-3" @click="toPath('permission')">权限</el-menu-item>
            <el-menu-item index="1-4" @click="toPath('system')">字典</el-menu-item>
          </el-menu-item-group>
          <el-menu-item index="5" @click="toPath('village')">数据列表 </el-menu-item>
        </el-menu>
      </el-aside>
      <el-main>
        <router-view></router-view>
      </el-main>
    </el-container>
  </el-container>
</template>
<script setup lang="ts">
import { onMounted } from "vue";
import { useRouter } from "vue-router";
const router = useRouter();

const toPath = (path) => {
  router.push(path);
};

const fun = () => {
  const amis = amisRequire("amis/embed");
  amis.embed("#side", {
    type: "app",
    brandName: "管理端",
    pages: [
      {
        label: "系统",
        children: [
          { label: "父页面", url: "/#/" },
          { label: "数据列表", url: "/#/village" },

          { label: "用户", url: "/#/user" },
          { label: "角色", url: "/#/role" },
          { label: "权限", url: "/#/permission" },
          { label: "字典", url: "/#/system" },
        ],
      },
    ],
  });
};
onMounted(() => {});
</script>

<style></style>
